package com.yl.chainStore.common.enums

import com.baomidou.mybatisplus.annotation.EnumValue
import com.fasterxml.jackson.annotation.JsonValue

enum class TypeEnum(@EnumValue val code: Int, @JsonValue val typeName: String) {

    //1-20 物品管理
    PAY_ITEM_GOODS(1,"商品"),
    PAY_ITEM_SERVICE(2,"服务"),
    PAY_ITEM_CONSUMABLES(3,"耗材"),

    //21-30 入库类型
    WAREHOUSE_IN_TYPE_SUPPLIER(21,"采购入库"),
    WAREHOUSE_IN_TYPE_DEPT(22,"部门退领"),
    WAREHOUSE_IN_TYPE_USER(23,"用户退领"),

    //31-39 出库类型
    WAREHOUSE_OUT_TYPE_SUPPLIER(31,"采购退货"),
    WAREHOUSE_OUT_TYPE_DEPT(32,"部门领用"),
    WAREHOUSE_OUT_TYPE_USER(33,"员工领用"),
    WAREHOUSE_OUT_TYPE_ORDER(34,"销售出库"),
    WAREHOUSE_OUT_TYPE_SCRAP(35,"报废出库"),
    WAREHOUSE_OUT_TYPE_SCATTERED(36,"零散出库"),


    //51-60   仓库记录类型
    WAREHOUSE_LOG_TYPE_IN_ORDER(51,"入库单记录"),
    WAREHOUSE_LOG_TYPE_OUT_ORDER(52,"出库单记录"),
    WAREHOUSE_LOG_TYPE_DISPATCH_ORDER_IN(53,"调度单入库记录"),
    WAREHOUSE_LOG_TYPE_DISPATCH_ORDER_OUT(54,"调度单出库记录"),
    WAREHOUSE_LOG_TYPE_CHECK_ORDER_ADD(55,"盘点添加记录"),
    WAREHOUSE_LOG_TYPE_CHECK_ORDER_SUB(56,"盘点减少记录"),
    WAREHOUSE_LOG_TYPE_PROFIT_LOSS_PROFIT(57,"损益添加记录"),
    WAREHOUSE_LOG_TYPE_PROFIT_LOSS_LOSS(58,"损益减少记录"),

    //301-350 客户修改记录类型
    CUSTOMER_UPDATE_LOG_TYPE_DEFAULT(301,"默认修改"),

    //351-400 病人访问记录
    ACCESS_LOG_RETURN_VISIT(351,"回访"),
    ACCESS_LOG_FOLLOW_UP(352,"随访"),


    //411-430 损益单明细类型
    WAREHOUSE_PROFIT_LOSS_TYPE_NEW_ADD(411,"新增"),
    WAREHOUSE_PROFIT_LOSS_TYPE_CHECK_ORDER(412,"盘点"),

    //431-440 性别
    USER_GENDER_BOY(431,"男"),
    USER_GENDER_GIRL(432,"女"),

    //441-460 证件类型
    USER_CARD_TYPE_ID_CARD(441,"身份证"),
    USER_CARD_TYPE_HK(442,"港澳台"),

    //461-480 挂号诊断类型
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST(461,"初诊"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_AGAIN(462,"复诊"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_SOME_CLINICAL(463,"初诊-点诊"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_TO_INTRODUCE(464,"初诊-转介绍"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_OLD_CUSTOMER(465,"初诊-老客户"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_PLANT(466,"初诊-种植"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_CORRECTION(467,"初诊-矫正"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_RETURNED_CUSTOMER(468,"初诊-回头客"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_COUNCSEL(469,"初诊-咨询"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_AGAIN_REDEVELOPMENT(470,"复诊-再开发"),
    SICK_MEDICAL_RECORD_DETAIL_TYPE_FIRST_MEI_TUAN(471,"初诊-美团"),

  //481-550 用户余额变动类型
    PAY_TYPE_TOP_UP(481,"余额充值"),          // 直接充值
    PAY_TYPE_PAY_ORDER(482,"订单支付"),  //余额扣款
    PAY_TYPE_ORDER_REFUND(483,"订单退款"),    //订单退款

    PAY_TYPE_BALANCE_REFUND(484,"余额退现"),    //余额变现
    PAY_TYPE_BALANCE_TRANSFER_SUB(485,"转出账户"),
    PAY_TYPE_BALANCE_TRANSFER_TOP(486,"转入账户"),
    PAY_TYPE_BALANCE_ORDER_PAY(487,"订单付款充值"),
    PAY_TYPE_REFUND_PAY_ORDER(488,"退款金额付款结算"),
    PAY_TYPE_ORDER_REFUND_TO_MONEY(489,"订单退现"),



    //551-570 客户预约类型
    CUSTOMER_SUBSCRIBE_TYPE_NORMAL(551,"普通"),
    CUSTOMER_SUBSCRIBE_TYPE_UNDETERMINDED(552,"待定"),

    //571-580 客户预约来源类型
    CUSTOMER_SUBSCRIBE_SOURCE_EXTERNAL(571,"外部来源"),
    CUSTOMER_SUBSCRIBE_SOURCE_INTERNAL(572,"内部来源"),

    //581 - 620 优惠卷类型
    CUSTOMER_COUPONS_CASH(581,"现金券"),
    CUSTOMER_COUPONS_PACKAGE(582,"套餐券"),
    CUSTOMER_COUPONS_DISCOUNT(583,"折扣券"),


    //621-640  公司收款类型
    COMPANY_COLLECTION_TYPE_ORDER(621,"订单收款"),



    //641-700 支付方式
    CUSTOMER_PAY_TYPE_ACCOUNT(641,"账户余额"),
    CUSTOMER_PAY_TYPE_MONEY(642,"现金"),
    CUSTOMER_PAY_TYPE_ALIPAY(643,"支付宝"),
    CUSTOMER_PAY_TYPE_WECHAT(644,"微信"),
    CUSTOMER_PAY_TYPE_WORD_OF_MOUTH(645,"口碑"),
    CUSTOMER_PAY_TYPE_BANK_CARD(646,"银行卡"),
    CUSTOMER_PAY_TYPE_ADVANCE_PAYMENT(647,"预付款"),
    CUSTOMER_PAY_TYPE_SOCIAL_SECURITY_CARD(648,"社保卡"),
    CUSTOMER_PAY_TYPE_CITY_HEALTH_CARD(649,"市医保"),
    CUSTOMER_PAY_TYPE_PROVINCIAL_HEALTH_CARD(650,"省医保"),
    CUSTOMER_PAY_TYPE_PROVINCIAL_TRANSFER(651,"转账"),
    //其他
    CUSTOMER_PAY_TYPE_TIDE_SHARE(652,"潮分享"),
    CUSTOMER_PAY_TYPE_PING_AN_GOOD_DOCTOR(653,"平安好医生"),
    CUSTOMER_PAY_TYPE_MEITUAN(654,"美团"),
    CUSTOMER_PAY_TYPE_LETOOTH_MESH(655,"乐牙网"),
    CUSTOMER_PAY_TYPE_NANCHANG_LINE(656,"南昌一线"),

//    CUSTOMER_PAY_TYPE_CUSTOMER_ACCOUNT_TRANSFER(657,"账号转账"),
    CUSTOMER_PAY_TYPE_ORDER_REFUND(658,"订单退款"),
    CUSTOMER_PAY_TYPE_ACCOUNT_GIFT(659,"馈赠金"),
    CUSTOMER_PAY_TYPE_OTHER(660,"其他方式"),
    CUSTOMER_PAY_TYPE_OTHER_OTHER(661,"其它"),
    CUSTOMER_PAY_TYPE_YI_BAO_KA(662,"医保卡"),
    CUSTOMER_PAY_TYPE_SHI_YI_BAO_KA(663,"市医保卡"),
    CUSTOMER_PAY_TYPE_WECHAT_PAY(664,"微信付款"),
    CUSTOMER_PAY_TYPE_SHEN_YI_BAO_KA(665,"省医保卡"),
    CUSTOMER_PAY_TYPE_REFUND_PAY(667,"退款付款"),
    CUSTOMER_PAY_TYPE_REFUND_KOU_BEI(668,"口碑"),




    /**
     * 700-720 技加工订单状态
     */
    TECHNOLOGY_PROCESSING_NEW(701,"新建"),
    TECHNOLOGY_PROCESSING_MAKING(702,"制作中"),
    TECHNOLOGY_PROCESSING_MAKED(703,"制作完成"),
    TECHNOLOGY_PROCESSING_FINISHED(704,"已完成"),

    //721-740 优惠卷使用方式
    CUSTOMER_COUPONS_TIME_TYPE_DAY_TO_DAY(721,"按日期计算"),
    CUSTOMER_COUPONS_TIME_TYPE_AFTER_DAY_TO_DAY(722,"按发放时间计算"),

    //741 - 840  用户操作记录 模块类型
    COMPANY_USER_OPERATION_LOG_MODEL_TYPE_RECORD(741,"就诊相关"),
    OMPANY_USER_OPERATION_LOG_MODEL_TYPE_OTHER(840,"其他模块"),

    //841 - 1100 用户操作记录  具体类型
    COMPANY_USER_OPERATION_LOG_TABLE_TYPE_RECORD_DETAIL(841,"就诊记录"),
    COMPANY_USER_OPERATION_LOG_TABLE_TYPE_MEDICAL_HISTORY(842,"病历"),
    COMPANY_USER_OPERATION_LOG_TABLE_TYPE_SUBSCRIBE_LOG(843,"预约"),
    COMPANY_USER_OPERATION_LOG_TABLE_TYPE_OTHER(1100,"其他内容"),

    //1101-1110 用户操作记录  具体类型
    COMPANY_USER_OPERATION_LOG_UPDATE_TYPE_NEW_ADD(1101,"新增"),
    COMPANY_USER_OPERATION_LOG_UPDATE_TYPE_UPDATE(1102,"修改"),
    COMPANY_USER_OPERATION_LOG_UPDATE_TYPE_DEL(1103,"删除"),

    //1111 - 1200 记录的字段类型 (注解用)
    COMPANY_USER_OPERATION_LOG_COLUMN_TYPE_DEFAULT(1111,"字段类型 - 默认"),
    COMPANY_USER_OPERATION_LOG_COLUMN_COMPANY_USER(1112,"字段类型 - 医院用户"),
    COMPANY_USER_OPERATION_LOG_COLUMN_CUSTOMER_INFO(1113,"字段类型 - 患者"),
    COMPANY_USER_OPERATION_LOG_COLUMN_JSON(1114,"字段类型 - JSON"),
    COMPANY_USER_OPERATION_LOG_COLUMN_SICK_LABEL(1115,"病历标签"),
    COMPANY_USER_OPERATION_LOG_COLUMN_TYPE_ENUM(1116,"类型枚举"),
    COMPANY_USER_OPERATION_LOG_COLUMN_DATE_TIME(1117,"日期时间"),
    COMPANY_USER_OPERATION_LOG_COLUMN_DEPT(1118,"部门"),
    COMPANY_USER_OPERATION_LOG_COLUMN_SUBSCRIBE_LOG_ITEMS(1119,"预约项目"),
    COMPANY_USER_OPERATION_LOG_COLUMN_STATUS_ENUM(1120,"状态枚举"),


    //1201-1220 随访随访方式
    ACCESS_LOG_CONTACT_PHONE(1201,"电话联系"),
    ACCESS_LOG_CONTACT_SMS(1202,"短信联系"),
    ACCESS_LOG_CONTACT_QQ(1203,"QQ联系"),
    ACCESS_LOG_CONTACT_WECHAT(1204,"微信联系"),
    ACCESS_LOG_CONTACT_FACE_TO_FACE(1205,"面聊"),

    //1221-1300 生成号码类型
    SYS_NUM_GENERATOR_SICK(1221,"病历号码"),
    SYS_NUM_GENERATOR_PAY_LOG(1222,"付款订单"),
    SYS_NUM_GENERATOR_ORDER(1223,"订单号码"),

    //1301-1310 患者来源 三层来源类型
    CUSTOMER_INFO_SOURCE_DIST(1301,"默认类型"),
    CUSTOMER_INFO_SOURCE_COMPANY_USER(1302,"用户"),
    CUSTOMER_INFO_SOURCE_CUSTOMER_INFO(1303,"患者"),



    //1311-1350 打印订单类型
    PAY_ORDER_PRINT_TYPE_NORMAL(1311,"普通订单"),
    PAY_ORDER_PRINT_TYPE_OWE(1312,"欠款订单"),

    //1351-1360
    CUSTOMER_PHONE_TYPE_MOBILE(1351,"患者电话-手机"),
    CUSTOMER_PHONE_TYPE_PHONE(1352,"患者电话-座机"),

    //1361 - 1370 订单付款类型
    PAY_ORDER_PAY_LOG_PAY_TYPE_NORMAL(1361,"收费"),
    PAY_ORDER_PAY_LOG_PAY_TYPE_OWE(1362,"收欠费"),
    PAY_ORDER_PAY_LOG_PAY_TYPE_REFUND(1363,"退款"),

    //1371 - 1380
    INCOME_SUMMARY_SELECT_TYPE_DETAIL(1371,"明细"),
    INCOME_SUMMARY_SELECT_TYPE_SUMMARY(1372,"汇总"),

    //1381-1410   退款方式
    ORDER_REFUND_TYPE_TO_BALANCE(1381,"订单退至余额"),
    ORDER_REFUND_TYPE_TO_MONEY(1382,"订单退至现金"),
    ORDER_REFUND_TYPE_SUB_ORDER(1383,"减少订单需付款"),


    //1411-1450 订单需付款金额修改类型
    ORDER_ORIGINAL_PRICE_UPDATE_TYPE_REFUND(1411,"订单金额变动-订单退款"),
    ORDER_ORIGINAL_PRICE_UPDATE_TYPE_DISCOUNT(1412,"订单金额变动-折扣"),

    //1451- 1500 订单退款类型（退款操作类型）
    CUSTOMER_ORDER_REFUND_TYPE_ORDER(1451,"订单退款-订单减金额"),
    CUSTOMER_ORDER_REFUND_TYPE_ITEM(1452,"订单退款-退项目"),


    //1501 - 1550  随访按模版创建类型
    SICK_CUSTOMER_ACCESS_LOG_MODEL_CREATE_TYPE_CREATE_ALL(1501,"一次性创建"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_CREATE_TYPE_CREATE_BY_LAST_OVER(1502,"完成上次时创建"),

    //1551-1600     随访按模版创建医生类型
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DOCTOR_TYPE_FIRST_SICK_DOCTOR(1551,"初诊医生"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DOCTOR_TYPE_SICK_DOCTOR(1552,"就诊医生"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DOCTOR_TYPE_RESPONSIBILITY_FOR_THE_DOCTOR(1553,"责任医生"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DOCTOR_TYPE_OTHER_DOCTOR(1554,"其他医生"),

    //1601-1650  随访按模版创建随访人类型
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DEAL_USER_TYPE_FIRST_SICK_CONSULTANT(1601,"初诊咨询师"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DEAL_USER_TYPE_SICK_CONSULTANT(1602,"就诊咨询师"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DEAL_USER_TYPE_CONSULTANT(1603,"所属咨询师"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DEAL_USER_TYPE_NET_CONSULTANT(1604,"所属网电咨询师"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_DEAL_USER_TYPE_OTHER(1605,"其他人员"),

    //1651-1660 随访按模版创建间隔时间类型
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_TIME_TYPE_DAY(1651,"天"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_TIME_TYPE_WEEK(1652,"周"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_DETAIL_TIME_TYPE_MONTH(1653,"月"),




    //1661-1670移动排序类型
    MOVE_TYPE_UP(1661,"上移"),
    MOVE_TYPE_DOWN(1662,"下移"),

    //1671-1680 随访按模版创建间隔时间类型
    SICK_CUSTOMER_ACCESS_LOG_MODEL_CREATE_TIME_INTERVAL_TYPE_FIRST(1671,"绝对时间模式"),
    SICK_CUSTOMER_ACCESS_LOG_MODEL_CRATE_TIME_INTERVAL_TYPE_LAST(1672,"相对时间模式"),

    /**
     * 其他
     */
    OTHER(32760, "其他");

    companion object {
        fun getEnum(d: Int?): TypeEnum {
            return values().find { it.code == (d ?: return OTHER) } ?: OTHER
        }


    }

    fun getMap():MutableMap<String,Any>{
        val map = mutableMapOf<String,Any>()
        map["id"] = this.typeName
        map["name"] = this.typeName
        return map
    }
}
